package com.mall.shopping.dto;


import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.shopping.constants.ProductCatSort;
import jdk.nashorn.internal.runtime.GlobalConstants;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by ciggar on 2019/8/8
 * 21:46.
 */
@Data
public class AllProductCateRequest extends AbstractRequest {
    private String sort;

    @Override
    public void requestCheck() {
        if (!ProductCatSort.ASC.getSort().equals(sort) && !ProductCatSort.DESC.getSort().equals(sort)) {
            throw new ValidateException();
        }
    }
}
